/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javase - Reg3
 * <p>Powered by webrx On 2021-12-06 14:25:36
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Reg3 {
    public static void main(String[] args) {
        String str = "hello";
        //.*[A-Z].*
        // .代表一个符号
        if (str.matches("^.*[A-Z].*$")) {
            System.out.println(String.format("%s:有大写字母", str));
        } else {
            System.err.println(String.format("%s:没有大写字母", str));
        }

        // 判断字符串有没有数字
        System.out.println("hello".matches("^.*\\d.*$"));

        //判断有没有汉字
        System.out.println("china".matches("^.*[\u4e00-\u9fa5].*$"));

        String p = "^1[3,5,8]\\d{9}$";
        //13xxxx  15xxxx 18xxx 13000000000
        String phone = "13014577055"; //向短信验证码
        System.out.println("    1 3 0 1 4 5 7 7 0  3 3    ".replace(" ", "").matches(p));

        StringBuilder sbu = new StringBuilder();
        sbu.appendCodePoint(97);
        System.out.println(sbu.toString());
        System.out.println((char) 97);
        System.out.println((int) 'c');//99
        System.out.println((int) 'C');//67
    }
}
